package com.bifrost.entity;

import org.springframework.stereotype.Controller;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 积分规则默认设置
 * @author rangf
 * @date 2018/4/8
 */
@Entity
@Table(name = "BONUS_POINTS_CONFIG",indexes = {
        @Index(name = "MERCHANT_TYPE_CATEGORY_ID",columnList = "MERCHANT_ID,CUSTOMER_TYPE,CATEGORY_CODE",unique = true)
})
@NamedQuery(name = "BonusPointsConfig.findAll", query = "SELECT bc FROM BonusPointsConfig bc")
public class BonusPointsConfig extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ID", unique = true, nullable = false)
    private Long id;

    @Column(name = "CREATED_BY", length = 64)
    private String createdBy;

    @Column(name = "MERCHANT_ID")
    private Long merchantId;

    @Column(name = "CUSTOMER_TYPE")
    private Long customerType;

    /**
     * 积分目录代码
     * */
    @Column(name = "CATEGORY_CODE", length = 16)
    private String categoryCode;

    /**
     * 积分比率
     */
    @Column(name = "BONUS_POINTS_RATIO")
    private Integer bonusPointsRatio=1;

    /**
     * 促销时积分比率
     */
    @Column(name = "PROMOTION_POINTS_RATIO")
    private Integer promotionPointsRatio=0;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public Long getCustomerType() {
        return customerType;
    }

    public void setCustomerType(Long customerType) {
        this.customerType = customerType;
    }

    public String getCategoryCode() {
        return categoryCode;
    }

    public void setCategoryCode(String categoryCode) {
        this.categoryCode = categoryCode;
    }

    public Integer getBonusPointsRatio() {
        return bonusPointsRatio;
    }

    public void setBonusPointsRatio(Integer bonusPointsRatio) {
        this.bonusPointsRatio = bonusPointsRatio;
    }

    public Integer getPromotionPointsRatio() {
        return promotionPointsRatio;
    }

    public void setPromotionPointsRatio(Integer promotionPointsRatio) {
        this.promotionPointsRatio = promotionPointsRatio;
    }
}
